/*
 * Scaffold Application Framework
 *
 * Copyright (c) 2010 Sii Sp. z o.o. All rights reserved.
 */
package com.gdziarmaga.webshop.web.datatable;


/**
 * Holds the data of table's row.
 * 
 * @author Wojciech Kochman
 * @version 1.0
 * 
 * @param <T> the object type
 */
public abstract class BaseTableRow<T> {
    /**
     * Default constructor.
     * 
     * @param domainObject the domain Object hold in row.
     */
    public BaseTableRow(T domainObject) {
        this.domainObject = domainObject;
    }

    /**
     * The domain Object hold in row.
     */
    protected T domainObject;
    
    protected boolean selected;
    /**
     * The style of cells in row.
     */
    protected BaseCellStyle cellStyle;

    /**
     * Getter for domainObject.
     * 
     * @return the domainObject
     */
    public T getDomainObject() {
        return domainObject;
    }

    /**
     * Gets the style of row.
     * 
     * @return the row style class
     */
    public abstract String getRowStyle();

    /**
     * Gets the row cell's style.
     * 
     * @return the row cell's style
     */
    public BaseCellStyle getCellStyle() {
        return cellStyle;
    }

    /**
     * Getter for selected.
     * @return the selected
     */
    public boolean isSelected() {
        return selected;
    }

    /**
     * Setter for selected.
     * @param selected the selected to set
     */
    public void setSelected(boolean selected) {
        this.selected = selected;
    }


    /**
     * Should have methods to get style for specific row's cell.
     * 
     * @author Wojciech Kochman
     * @version 1.0
     */
    public abstract class BaseCellStyle {
    }
    
    
//    @Override
//    public boolean equals(Object obj) {
//        if (obj instanceof BaseTableRow<?> == false) {
//            return false;
//        }
//        if (this == obj) {
//            return true;
//        }
//        BaseTableRow<T> other = (BaseTableRow<T>) obj;
//        return new EqualsBuilder().append(this.domainObject, other.domainObject).isEquals();
//    }
//    @Override
//    public int hashCode() {
//        return new HashCodeBuilder().append(this.domainObject).toHashCode();
//    }
//    @Override
//    public String toString() {
//        return new ToStringBuilder(this).append("domainObject", this.domainObject).toString();
//    }

}
